'use strict';

const puppeteer = require('puppeteer');



(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setViewport({
    width: 1366,
    height: 768
  });
  await page.goto('http://www.sipo.gov.cn/jcdlgg/index.html');
  const linkSelector = 'body > div > div > div.index_articl_pane > div > div.index_articl_list > ul > li > a'
  const links = await page.evaluate(link => {
    const anchors = Array.from(document.querySelectorAll(link));
    return anchors.map(anchor => {
        return anchor.href;
    })
  }, linkSelector);

  console.log(links);

  await browser.close();
})();